package com.soft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.soft.entity.Store;
import com.soft.service.StoreService;

@RestController
@RequestMapping("/store")
public class StoreController {
    @Autowired
    private StoreService storeService;
    @GetMapping("/list")
    public List<Store> list() {
        return storeService.queryAll();
    }
    
    @RequestMapping("/deleteById")
	public String deleteById(Long storeId) {
		int num = storeService.deleteById(storeId);
		if(num ==1) {
			return storeId+"删除成功";
		}else 
		{
			return storeId+"删除失败";
		}
	}
}
